package com.hdax.dm.controller;

import com.hdax.dm.beans.base.area;
import com.hdax.dm.beans.base.image;
import com.hdax.dm.dto.CarouseDto;
import com.hdax.dm.dto.areaDto;
import com.hdax.dm.service.areaService;
import com.hdax.dm.service.imageService;
import com.hdax.dm.utils.response.CommonResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/base")
public class CarouselController {

    @Autowired
    private imageService imageService;

    @Autowired
    private areaService areaService;

    /**
     * 首页轮播图
     * @return
     */
    @PostMapping("index/carousel")
    public CommonResponse<List<image>> indexlinenav(){
        return imageService.imagelist();
    }

    /**
     * 搜索界面的地址查询
     */
    @PostMapping("list/querycity")
    public CommonResponse<List<areaDto>> querycity(){
        return areaService.querycity();
    }
}
